#[allow(non_snake_case)]
pub mod HoFile {
    use std::fs::{read, read_to_string, File};
    use std::io::{Write, Error};
    use ho_string::HoString;
    #[allow(dead_code)]
    pub fn read_file_all(filename: &str, default_str: &str) -> HoString {
        let mut string: HoString = HoString::new();
        let content: Result<String, Error> = read_to_string(filename);
        if let Some(x) = content.ok() {
            string.push_str(x.as_str());
            return string;
        } else {
            string.push_str(default_str);
            return string;
        }
    }
    #[allow(dead_code)]
    pub fn read_file_bytes(filename: &str) -> HoString {
        let mut string: HoString = HoString::new();
        let content: Result<Vec<u8>, Error> = read(filename);
        if let Ok(u8_vec) = content {
            string.push_bytes(u8_vec.as_slice());
            return string;
        } else {
            return string;
        }
    }
    #[allow(dead_code)]
    pub fn read_file_u8vec(filename: &str) -> Vec<u8> {
        let content: Result<Vec<u8>, Error> = read(filename);
        if let Ok(u8_vec) = content {
            return u8_vec;
        } else {
            let u8vec: Vec<u8> = Vec::new();
            return u8vec;
        }
    }
    #[allow(unused_must_use)]
    pub fn write_file(filename: &str, write_str: &str) {
        let file: Result<File, Error> = File::create(filename);
        if let Ok(mut f) = file {
            f.write_all(write_str.as_bytes());
        }
    }
    #[allow(unused_must_use)]
    pub fn write_file_bytes(filename: &str, write_bytes: &[u8]) {
        let file: Result<File, Error> = File::create(filename);
        if let Ok(mut f) = file {
            f.write_all(write_bytes);
        }
    }
}
